package com.zch.news.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 
 * @ClassName: CloseObject 
 * @Description:关闭各种流对象
 * @author: zch
 * @version: 1.10
 * @date: 2018年8月28日 下午3:04:10
 */
public class CloseObject {
	public static void close(Connection conn,PreparedStatement ps) {
		try {
			//关闭对象
			conn.close();
			ps.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	public static void close(Connection conn,ResultSet rs) {
		try {
			//关闭对象
			conn.close();
			rs.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	
	public static void close(Connection conn,PreparedStatement ps,ResultSet rs) {
		try {
			//关闭对象
			conn.close();
			ps.close();
			rs.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
